<?php
/*
 * @Description:
 * @Author: 橘子味的心
 * @Date: 2020-11-13 15:02:02
 * @LastEditTime: 2021-01-13 20:38:34
 * @LastEditors: 橘子味的心
 * @Reference:
 */

namespace x_mier\neditor;

use think\Route;
use x_mier\neditor\util\Recource;

class Service extends \think\Service
{
    public function boot(Route $route)
    {
        $route->rule('neditor/index', "\\x_mier\\neditor\\controller\\Neditor@index")
            ->middleware(\think\middleware\SessionInit::class);

        $route->rule('neditor/setting/index', "\\x_mier\\neditor\\controller\\Setting@index")
            ->middleware(\think\middleware\SessionInit::class);
        $route->rule('neditor/setting/save', "\\x_mier\\neditor\\controller\\Setting@save")
            ->middleware(\think\middleware\SessionInit::class);
        $route->rule('neditor/setting/upload_imgage', "\\bingher\\neditor\\controller\\Setting@uploadImage")
            ->middleware(\think\middleware\SessionInit::class);

        $route->rule('neditor/demo/view', "\\x_mier\\neditor\\controller\\Demo@view");
        $route->rule('neditor/demo/setting', "\\x_mier\\neditor\\controller\\Demo@setting");

        $route->get('neditor/assets', "\\x_mier\\neditor\\controller\\Base@assets", ['deny_ext' => 'php|.htacess']);
        // $route->get('neditor/assets/neditor/php', "\\x_mier\\neditor\\controller\\neditor@index");
        
        //安装资源文件到本地使用下面
        // Recource::install(false); //检查资源文件
        // $this->commands(['neditor:publish' => Publish::class]);
    }
}
